package com.probox.common.entity.domain.customer;

import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.probox.common.core.annotation.Excel;
import com.probox.common.core.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;

/**
 * 客户收货地址对象 customer_address
 *
 * @author zsy
 * @date 2021-06-18
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("customer_address")
@ApiModel(description="客户地址")
public class CustomerAddress implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 客户地址id
     */
    //默认主键自增
    @ApiModelProperty(value = "客户地址id")
    @TableId(value = "ADDRESS_UID", type = IdType.AUTO)
    private Long addressUid;
    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
//    @Excel(name = "${comment}", readConverterExp = "客户id")
    private Long customerUid;

    /**
     * 平台ID
     */
    @ApiModelProperty(value = "平台ID")
    private Long platformUid;
    /**
     * 收货人姓名
     */
    @ApiModelProperty(value = "收货人姓名")
    @Excel(name = "收货人姓名")
    private String name;
    /**
     * 收货人联系电话
     */
    @ApiModelProperty(value = "收货人联系电话")
    @Excel(name = "收货人联系电话")
    private String mobile;
    /**
     * 省份代码
     */
    @ApiModelProperty(value = "省份代码")
    private String provinceCode;
    /**
     * 省份名称
     */
    @ApiModelProperty(value = "省份名称")
    @Excel(name = "省份名称")
    private String provinceName;
    /**
     * 城市代码
     */
    @ApiModelProperty(value = "城市代码")
    private String cityCode;
    /**
     * 城市名称
     */
    @ApiModelProperty(value = "城市名称")
    @Excel(name = "城市名称")
    private String cityName;
    /**
     * 区县代码
     */
    @ApiModelProperty(value = "区县代码")
    private String countyCode;
    /**
     * 区县名称
     */
    @ApiModelProperty(value = "区县名称")
    @Excel(name = "区县名称")
    private String countyName;
    /**
     * 详细地址
     */
    @ApiModelProperty(value = "详细地址")
    @Excel(name = "详细地址")
    private String address;
    /**
     * 邮政编号
     */
    @ApiModelProperty(value = "邮政编号")
    @Excel(name = "邮政编号")
    private Long postCode;
    /**
     * 是否默认地址
     */
    @ApiModelProperty(value = "是否默认地址")
    @Excel(name = "是否默认地址",readConverterExp = "0=否,1=是")
    private String isDefault;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 修改人id
     */
    @ApiModelProperty(value = "修改人id")
    private Long updateUid;

    /**
     * 创建人id
     */
    @ApiModelProperty(value = "创建人id")
    private Long createUid;

    /**
     * 创建人名称
     */
    @ApiModelProperty(value = "创建人名称")
    private String createName;

    /**
     * 修改人名称
     */
    @ApiModelProperty(value = "修改人名称")
    private String updateName;

    /**
     * 数据状态 0无效 1有效 -1删除
     */
    @ApiModelProperty(value = "数据状态")
    private String dataStatus;

    public String getMobileStr(){
        String mobile =  this.mobile;
        if (!StringUtils.isEmpty(mobile)){
            String mobileStr = StringUtils.ShowPhoneStr(mobile);
            return mobileStr;
        }
        return null;
    }

}
